<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUserRecValueTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_rec_value', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户ID');
            $table->smallInteger('hot_value')->default(0)->comment('精选榜单分值');
            $table->smallInteger('new_value')->default(0)->comment('最新榜单分值');
            $table->smallInteger('other_value')->default(0)->comment('其他榜单分值');
            $table->timestamps();
            $table->unique('user_id', 'user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_recommend');
    }
}
